package data.process;

import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;

import weeny.util.Entropy;


public class DocInfo{
	public static Comparator<DocInfo> DATE_ACCENDING = new Comparator<DocInfo>() {
		public int compare(DocInfo o1, DocInfo o2) {
			if (o1.date > o2.date)
				return 1;
			if (o1.date < o2.date)
				return -1;
			return 0;
		}
	};
	
	public int date;
	public int ID;
	public Map<String, Integer> freqs = new HashMap<String, Integer>();
	private Double entropy = null;
	public double entropy(){
		if (entropy == null) {
			entropy = Entropy.entropy(freqs.values(), CurveGen.BIN_NUM);
		}
		return entropy.doubleValue();
	}
}
